import Vue from 'vue'
import Router from 'vue-router'
import jv from "./api/jv.js"

Vue.use(Router);

var router = new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            component: resolve => require(['./view/home/HomePage.vue'], resolve)
        },
        {
            path: '/admin-user/list',
            component: resolve => require(['./view/admin/UserList.vue'], resolve)
        },
        {
            path: '/admin-user/add',
            component: resolve => require(['./view/admin/UserCard.vue'], resolve)
        },
        {
            path: '/admin-user/(add|edit)/:id',
            props:true,
            component: resolve => require(['./view/admin/UserCard.vue'], resolve)
        },
        {
            path: '/MyData',
            component: resolve => require(['./view/admin/MyData.vue'], resolve)
        },
        {
            path: '/ChangePassword',
            component: resolve => require(['./view/admin/ChangePwd.vue'], resolve)
        }
    ]
});


//-----------------------------------
// jv.initRouter(router);

export default router;


